var font1 = document.getElementsByClassName('font1')[0];
var input1s = font1.getElementsByTagName('input');
var tian1s = document.getElementsByClassName('tian1-1');
var right1 = document.getElementsByClassName('right1')[0];
var false1 = document.getElementsByClassName('false1')[0];
var wrap1 = document.getElementsByClassName('wrap1')[0];
var wrap2 = document.getElementsByClassName('wrap2')[0];


var rightNum = 0;
var falseNum = 0;


function loopTouch1(){
	for(var i = 0;i < input1s.length;i ++){
		input1s[i].addEventListener('touchstart',function(){

			var a = this.value;

			if(tian1s[0].innerHTML == ''){
				tian1s[0].innerHTML = a;
			}else if (tian1s[1].innerHTML == ''){
				tian1s[1].innerHTML = a;
			}


			if(tian1s[0].innerHTML == '拼' && tian1s[1].innerHTML == '车'){
				right1.style.display = 'block';
				rightNum ++;
				right1.addEventListener('touchstart',function(){
					wrap1.style.display = 'none';
					right1.style.display = 'none';
					wrap2.style.display = 'block';
				});
			}
			if(tian1s[0].innerHTML != '' && tian1s[1].innerHTML != '' && (tian1s[0].innerHTML != '拼' || tian1s[1].innerHTML != '车')){
				false1.style.display = 'block';
				falseNum ++;
				false1.addEventListener('touchstart',function(){
					wrap1.style.display = 'none';
					right1.style.display = 'none';
					wrap2.style.display = 'block';
				});
			}
		});
	}
}
loopTouch1();

var font2 = document.getElementsByClassName('font2')[0];
var input2s = font2.getElementsByTagName('input');
var tian2s = document.getElementsByClassName('tian2-1');
var right2 = document.getElementsByClassName('right2')[0];
var false2 = document.getElementsByClassName('false2')[0];
var wrap3 = document.getElementsByClassName('wrap3')[0];

function loopTouch2(){
	for(var j = 0;j < input2s.length;j ++){
		input2s[j].addEventListener('touchstart',function(){

			var a = this.value;
			if(tian2s[0].innerHTML == ''){
				tian2s[0].innerHTML = a;
			}else if(tian2s[1].innerHTML == ''){
				tian2s[1].innerHTML = a;
			}else{
				tian2s[2].innerHTML = a;
			}


			if(tian2s[0].innerHTML == '一' && tian2s[1].innerHTML == '口' && tian2s[2].innerHTML == '价'){
				right2.style.display = 'block';
				rightNum ++;
				right2.addEventListener('touchstart',function(){
					wrap2.style.display = 'none';
					right2.style.display = 'none';
					wrap3.style.display = 'block';
				});
			}

			if(tian2s[0].innerHTML != '' && tian2s[1].innerHTML != '' && tian2s[2].innerHTML != '' && (tian2s[0].innerHTML != '一' || tian2s[1].innerHTML != '口' || tian2s[2].innerHTML != '价')){
				false2.style.display = 'block';
				falseNum ++;
				false2.addEventListener('touchstart',function(){
					wrap2.style.display = 'none';
					false2.style.display = 'none';
					wrap3.style.display = 'block';
				});
			}

		});
	}
}
loopTouch2();


var font3 = document.getElementsByClassName('font3')[0];
var input3s = font3.getElementsByTagName('input');
var tian3s = document.getElementsByClassName('tian3-1');
var right3 = document.getElementsByClassName('right3')[0];
var false3 = document.getElementsByClassName('false3')[0];
var wrap4 = document.getElementsByClassName('wrap4')[0];



function loopTouch3(){
	for(var i = 0;i < input3s.length;i ++){
		input3s[i].addEventListener('touchstart',function(){
			var a = this.value;

			if(tian3s[0].innerHTML == ''){
				tian3s[0].innerHTML = a;
			}else if(tian3s[1].innerHTML == ''){
				tian3s[1].innerHTML = a;
			}else{
				tian3s[2].innerHTML = a;
			}


			if(tian3s[0].innerHTML == '限' && tian3s[1].innerHTML == '两' && tian3s[2].innerHTML == '人'){
				right3.style.display = 'block';
				rightNum ++;
				right3.addEventListener('touchstart',function(){
					
					wrap3.style.display = 'none';
					right3.style.display = 'none';
					wrap4.style.display = 'block';
				});
			}

			if(tian3s[0].innerHTML != '' && tian3s[1].innerHTML != '' && tian3s[2].innerHTML != '' && (tian3s[0].innerHTML != '限' || tian3s[1].innerHTML != '两' || tian3s[2].innerHTML != '人')){
				false3.style.display = 'block';
				falseNum ++;
				false3.addEventListener('touchstart',function(){
					
					wrap3.style.display = 'none';
					false3.style.display = 'none';
					wrap4.style.display = 'block';
				});
			}
		});
	}
}
loopTouch3();


var font4 = document.getElementsByClassName('font4')[0];
var input4s = font4.getElementsByTagName('input');
var tian4s = document.getElementsByClassName('tian4-1');
var right4 = document.getElementsByClassName('right4')[0];
var false4 = document.getElementsByClassName('false4')[0];
var wrap5 = document.getElementsByClassName('wrap5')[0];

function loopTouch4(){

	for(var i = 0;i < input4s.length;i ++){

		input4s[i].addEventListener('touchstart',function(){

			var a = this.value;

			if(tian4s[0].innerHTML == ''){
				tian4s[0].innerHTML = a;
			}else if(tian4s[1].innerHTML == ''){
				tian4s[1].innerHTML = a;
			}else if(tian4s[2].innerHTML == ''){
				tian4s[2].innerHTML = a;
			}else{
				tian4s[3].innerHTML = a;
			}


			if(tian4s[0].innerHTML == '零' && tian4s[1].innerHTML == '钱' && tian4s[2].innerHTML == '起' && tian4s[3].innerHTML == '步'){
				right4.style.display = 'block';
				rightNum ++;
				right4.addEventListener('touchstart',function(){
					wrap4.style.display = 'none';
					right4.style.display = 'none';
					wrap5.style.display = 'block';
				});
			}

			if(tian4s[0].innerHTML != '' && tian4s[1].innerHTML != '' && tian4s[2].innerHTML != '' && tian4s[3].innerHTML != '' && (tian4s[0].innerHTML != '零' || tian4s[1].innerHTML != '钱' || tian4s[2].innerHTML != '起' || tian4s[3].innerHTML != '步')){
				false4.style.display = 'block';
				falseNum ++;
				false4.addEventListener('touchstart',function(){
					wrap4.style.display = 'none';
					false4.style.display = 'none';
					wrap5.style.display = 'block';
				});
			}
		});
	}
}
loopTouch4();
var font5 = document.getElementsByClassName('font5')[0];
var input5s = font5.getElementsByTagName('input');
var tian5s = document.getElementsByClassName('tian5-1');
var right5 = document.getElementsByClassName('right5')[0];
var false5 = document.getElementsByClassName('false5')[0];

function loopTouch5(){

	for(var i = 0;i < input5s.length;i ++){
		input5s[i].addEventListener('touchstart',function(){
			var a = this.value;

			if(tian5s[0].innerHTML == ''){
				tian5s[0].innerHTML = a;
			}else if(tian5s[1].innerHTML == ''){
				tian5s[1].innerHTML = a;
			}else if(tian5s[2].innerHTML == ''){
				tian5s[2].innerHTML = a;
			}else{
				tian5s[3].innerHTML = a;
			}


			if(tian5s[0].innerHTML == '规' && tian5s[1].innerHTML == '划' && tian5s[2].innerHTML == '路' && tian5s[3].innerHTML == '线'){
				right5.style.display = 'block';
				rightNum ++;
			}

			if(tian5s[0].innerHTML != '' && tian5s[1].innerHTML != '' && tian5s[2].innerHTML != '' && tian5s[3].innerHTML != '' && (tian5s[0].innerHTML != '规' || tian5s[1].innerHTML != '划' || tian5s[2].innerHTML != '路' || tian5s[3].innerHTML != '线')){
				false5.style.display = 'block';
				falseNum ++;
			}

			if(rightNum == 5){
				right5.addEventListener('touchstart',function(){
					right5.style.display = 'none';
					wrap5.style.display = 'none';
					window.open('end_perfect.html','_self');
				});
			}
			if(rightNum >= 2 && rightNum <= 4){
				right5.addEventListener('touchstart',function(){
					right5.style.display = 'none';
					wrap5.style.display = 'none';
					window.open('end_good.html','_self');
				});
				false5.addEventListener('touchstart',function(){
					false5.style.display = 'none';
					wrap5.style.display = 'none';
					window.open('end_good.html','_self');
				});
			}
			if(rightNum == 0 || rightNum == 1){
				console.log(1);
				right5.addEventListener('touchstart',function(){
					right5.style.display = 'none';
					wrap5.style.display = 'none';
					window.open('end_poor.html','_self');
				});
				false5.addEventListener('touchstart',function(){
					false5.style.display = 'none';
					wrap5.style.display = 'none';
					window.open('end_poor.html','_self');
				});
			}
		});
	}
}
loopTouch5();



